using Lzfy_Refund_Service.Models;

namespace Lzfy_Refund_Service.Repositories
{
    public interface IRefundMasterRepository
    {
        Task<RefundMaster?> GetByIdAsync(int id);
        Task<RefundMaster?> GetByRelIdAsync(string relId);
        Task<IEnumerable<RefundMaster>> GetAllAsync();
        Task<(IEnumerable<RefundMaster> data, int totalCount)> GetRefundsWithFilterAsync(
            DateTime? startDate = null,
            DateTime? endDate = null,
            int? auditStatus = null,
            string? patientId = null,
            string? patientName = null,
            int pageIndex = 1,
            int pageSize = 20);
    Task<(IEnumerable<RefundMaster> data, int totalCount)> GetRefundStatisticsAsync(
        DateTime? startDate = null,
        DateTime? endDate = null,
        int? auditStatus = null,
        string? applicantType = null,
        string? patientId = null,
        string? patientName = null,
        string? bankCardHolder = null,
        int pageIndex = 1,
        int pageSize = 20);
        Task<IEnumerable<RefundMaster>> GetByPatientIdAsync(string patientId);
        Task<IEnumerable<RefundMaster>> GetByPatientIdAndDateRangeAsync(string patientId, int days);
        Task<int> CreateAsync(RefundMaster refundMaster);
        Task<bool> UpdateAsync(RefundMaster refundMaster);
        Task<bool> DeleteAsync(int id);
        Task<bool> UpdateAuditAsync(int id, RefundMasterUpdateRequest request);
        Task<bool> UpdateAuditWithConcurrencyCheckAsync(int id, RefundMasterUpdateRequest request);
        Task<bool> UpdateAcctIdWithConcurrencyCheckAsync(int id, string acctId);
        Task<bool> UpdateHisRefundStatusAsync(int id, string hisRefundStatus);
        Task<(IEnumerable<RefundMaster> data, int totalCount)> GetRefundsPagedAsync(int pageNumber, int pageSize, DateTime? startDate, DateTime? endDate, string? auditResult, string? settleStatus = null, string? bankCardHolder = null, string? auditUserName = null);
        Task<IEnumerable<RefundMaster>> GetByAcctIdAsync(string acctId);
    }
}